import 'package:json_annotation/json_annotation.dart';
import 'image_model.dart';
import 'user_model.dart';
part 'note_model.g.dart';

@JsonSerializable()
class NoteModel {
bool digged_by_req_user;
  String create_time;
  List<ImageModel> images;
  int id;
  ImageModel image;
  int n_diggs;
  int n_comments;
  int n_views;
  int recipe_id;
  String text;
  String update_time;
  String url;
  UserModel user;
  int user_id;

  NoteModel(
      this.digged_by_req_user,
      this.create_time,
      this.images,
      this.image,
      this.id,
      this.n_diggs,
      this.n_comments,
      this.n_views,
      this.recipe_id,
      this.text,
      this.update_time,
      this.url,
      this.user,
      this.user_id);

  factory NoteModel.fromJson(Map<String, dynamic> json) =>
      _$NoteModelFromJson(json);

  Map<String, dynamic> toJson() => _$NoteModelToJson(this);
}
